package com.tech.koufu.model;

import org.json.JSONObject;

import android.util.Log;

public class Stock extends EntityBase{
	public String name;
	public String code;
	public String text;
	public String content;
	public String queryCode;
	private String ncode;
	public Stock(){
		
	}
	
	public Stock(JSONObject jsonObject){
		String text = jsonObject.optString("text");
		String[] aas = text.split("\\s+");
		this.code = aas[0];
		this.name = aas[1];
		this.queryCode = aas[2]; 
		this.content = jsonObject.optString("content");
		this.text = text;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getContent() {
		return content;
	}
	public void setContext(String content) {
		this.content = content;
	}
	public String getQueryCode() {
		return queryCode;
	}
	public void setQueryCode(String queryCode) {
		this.queryCode = queryCode;
	}

	public String getNcode() {
		if(code!=null){
			String _pre = code.substring(0, 2);
			if(Integer.parseInt(_pre)>40){
				return "1"+code;
			}else{
				return "0"+code;
			}
		}
		return code;
	}

	public void setNcode(String ncode) {
		this.ncode = ncode;
	}
	
	
}
